MIP Continuation Packets

MIP packets are limited to 255 payload bytes. If enough fields are selected in the message format, this limit can be exceeded. When this happens, the payload is truncated at the end of the last whole field so that there are no fragmented fields. The remaining fields are added to a new packet of the same descriptor set, called a continuation packet. This process repeats until all fields have been transmitted. Here is an example using the descriptor set (to be concise, the 0x hexadecimal prefix has been omitted from the field descriptors):

Descriptors in Message Format: 11, 10, 01, 02, 04, 05, 06, 07, 08, 09, 40, 41, 36, 37, 42 (all at the same rate)
Required payload length: 290 bytes (requires 2 mip packets)
Packet #1 Field Descriptors: 11, 10, 01, 02, 04, 05, 06, 07, 08, 09, 40, 41, 36
Packet #2 Field Descriptors: 37, 42 Continuation packet
Packet #3 Field Descriptors: 11, 10, 01, 02, 04, 05, 06, 07, 08, 09, 40, 41, 36
Packet #4 Field Descriptors: 37, 42 Continuation packet
Packet #5 Field Descriptors: 11, 10, 01, 02, 04, 05, 06, 07, 08, 09, 40, 41, 36
Packet #6 Field Descriptors: 37, 42 Continuation packet
. . .

Determining which packets belong to the same group is important. In the example above, fields 0x37 and 0x42 are associated with the GPS timestamp (field descriptor 0x11) in the preceding packet. If the parser groups them the other way (e.g. packets 2 and 3, 4 and 5, etc.) then the timestamp for those fields will be effectively skewed. This can result in poor performance in real-time applications such as control loops.

To address this concern, typically the parser would be set up to look for the first and last fields in the message format. The data buffer would be reset upon receipt of the first field (0x11 from the example), and after the last field (0x42 from the example) is received the data would be sent on to the application for processing. This works well in embedded applications where multiple-rate data is not required and the message format and parsing code are part of the same system.

This doesn't work well in other situations, however. For example, parsing binary log files can be difficult when the message format is unknown. Multiple Rate Data also complicates the process because the MIP packets can contain different fields at different times even though the message format is fixed. While there are ways to deal with those situations, a simple solution may be to use one or more of the Shared Data Descriptors.

When placed at the beginning of the message format, fields belonging to the shared descriptor group will be copied to continuation packets. For example, the timestamp could be sent as the first field of every packet. All packets belonging to the same sample group would share the same timestamp, allowing the parser to group the data together. Here's the same example from before, modified to use the shared instead of the filter timestamp:

Descriptors in Message Format: D3, 10, 01, 02, 04, 05, 06, 07, 08, 09, 40, 41, 36, 37, 42 (all at the same rate)
Required payload length: 290 bytes (requires 2 mip packets)
Packet #1 Field Descriptors: D3, 10, 01, 02, 04, 05, 06, 07, 08, 09, 40, 41, 36
Packet #2 Field Descriptors: D3, 37, 42 Continuation packet
Packet #3 Field Descriptors: D3, 10, 01, 02, 04, 05, 06, 07, 08, 09, 40, 41, 36
Packet #4 Field Descriptors: D3, 37, 42 Continuation packet
Packet #5 Field Descriptors: D3, 10, 01, 02, 04, 05, 06, 07, 08, 09, 40, 41, 36
Packet #6 Field Descriptors: D3, 37, 42 Continuation packet
. . .

This time, the timestamp appears in every packet. The parser doesn't need to know the message format, and can simply group all of the data with the same timestamp. Notice that the additional field increases the total amount of data being transmitted. Most of the time this is acceptable, but it's important to factor this in when determining the available bandwidth.

Caution: The shared descriptors must be added to the beginning of the message format or poll request. If a message format or poll request contains standard descriptors preceding shared descriptors, the format of continuation packets is unspecified and subject to change. Therefore, place all shared descriptors at the front of the format or ensure the payload fits in one packet.